<div nz-row style="margin-bottom: 15px">
  <div nz-col [nzSpan]="6">
    <div>
      <button (click)="add()" nz-button nzType="default" [acl]="'sys:dict:edit'">新建数据项</button>
    </div>
  </div>
  <div nz-col [nzSpan]="2" [nzOffset]="4">
    <nz-tag style="cursor: pointer" (click)="copy(code)" title="点击复制">
      {{ code }}
    </nz-tag>
  </div>
  <div nz-col [nzSpan]="6" [nzOffset]="6">
    <div>
      <button (click)="delete.emit(this.id)" nz-button nzType="primary" nzDanger [acl]="'sys:dict:delete'">删除字典</button>
    </div>
  </div>
</div>

<st #st [data]="data" [columns]="columns" [pi]="pi" [ps]="ps" [total]="total" (change)="change($event)" [page]="{ front: false }">
  <ng-template st-row="nameTpl" let-item let-index="index">
    <div style="overflow: hidden">
      <input *ngIf="item._edit" nz-input [(ngModel)]="item.label" required placeholder="描述" />
      <span *ngIf="!item._edit">{{ item.label }}</span>
    </div>
  </ng-template>
  <ng-template st-row="valueTpl" let-item let-index="index" let-column="valueTpl">
    <div style="overflow: hidden">
      <input *ngIf="item._edit" nz-input [(ngModel)]="item.value" required placeholder="code" />
      <span *ngIf="!item._edit">{{ item.value }}</span>
    </div>
  </ng-template>
</st>
